//
// Created by LiuYou on 2021/7/24.
//

#ifndef MODERNCPP_MESSAGE_HPP
#define MODERNCPP_MESSAGE_HPP


#include <string>
#include <set>


namespace Demo {
    class Folder;

    class Message {
    public:
        void save(Folder& folder);

        void remove(Folder& folder);

    public:
        explicit Message(std::string contents);

        virtual ~Message();

        Message(const Message& rhs);

        Message& operator=(const Message& rhs);

        friend void swap(Message& lhs, Message& rhs);

    private:
        void addToFolders(const Message& message);

        void removeFromFolders();

    private:
        std::string contents;
        std::set<Folder*> folders;


    };

}


#endif //MODERNCPP_MESSAGE_HPP
